import http from "./$alova";

const immediate = {
  immediate: false,
  force: true
};

// 首页请求
export class HomeService {
  // 获取商品列表
  static getProduct() {
    return useRequest(
      (params: HomeServiceAPI.GetProduct.Req) =>
        http.Get<HomeServiceAPI.GetProduct.Res[]>(
          "/admin/product/getProductPage",
          { params }
        ),
      immediate
    );
  }
  // 获取商品详情
  static getProductId() {
    return useRequest(
      (params: HomeServiceAPI.getProductId.Req) =>
        http.Get<HomeServiceAPI.getProductId.Res[]>(
          "/getProduct/getSingle",
          { params }
        ),
      immediate
    );
  }

  
}
